﻿@model IEnumerable<AerolineaApp.Models.Avion>

@{
    ViewBag.Title = "Lista de Aviones";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Lista de Aviones</h2>
    <span style="margin-left: 900px">@Html.ActionLink("Volver Atras", "Index")</span><br /><br />
    <div style="height: 500px; overflow: auto;">
@foreach (var item in Model)
{
    <table>
    <tr>
    @if (item.Numero_Avion == 747)
    {
        <td valign="top">
            <img alt = "boeing747" width="250" src="../../Content/Images/boeing_747.jpg" />
        </td>
    }
    else if (item.Numero_Avion == 727)
    {
        <td valign="top">
            <img alt = "boeing727" width="250" src="../../Content/Images/boeing_727.jpg" />
        </td>
    }
    else
    {
        <td valign="top">
            <img alt = "boeing747" width="250" src="../../Content/Images/boeing_747.jpg" />
        </td>
    }
        <td valign="middle">
            <label>
            Descripcion: @Html.DisplayFor(modelItem => item.Descripcion) <br />
            Tipo De Avion: @Html.DisplayFor(modelItem => item.Numero_Avion) <br />
            Dia Actual De Trabajo: @Html.DisplayFor(modelItem => item.Dia) <br />
            Aerolinea: @Html.DisplayFor(modelItem => item.Aerolinea.Nombre)<br />
            </label>
        </td>
        <td>
            @Html.ActionLink("Editar", "Edit", new { id = item.Id }) |
            @Html.ActionLink("Detalles del Avion", "Details", new { id = item.Id }) |
            @Html.ActionLink("Borrar", "Delete", new { id = item.Id })
        </td>
    </tr>
    </table>   
}
</div>